<script setup>
import { emit } from "process";
import { ref } from "vue";
defineProps(["left", "right", "disable",'num','isReady']);
</script>

<template>
  <view class="bottom">
    <button
    v-if="!num"
      @click="$emit('leftClick')"
      class="left"
      :class="disable == false ? 'disable' : ''"
    >
      {{ left }}
    </button>
    <view v-else @click="$emit('leftClick')" class="left1">
      <text class="top">{{ left }}</text>
      <text class="bottom1">剩余{{ num }}条</text>
    </view>
    <button :class="isReady == false ? 'isready' : ''" @click="$emit('rightClick')" class="right">{{ right }}</button>
  </view>
</template>

<style lang="scss" scoped>
.bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  width: 100%;
  height: 166rpx;
  padding: 10rpx 30rpx 0;
  background-color: #fff;
  .left {
    width: 336rpx;
    height: 88rpx;
    text-align: center;
    line-height: 88rpx;
    background-color: #fff;
    color: rgb(142, 84, 244);
    border: 2rpx solid rgb(142, 84, 244);
    border-radius: 8rpx;
    font-size: 32rpx;
  }
  .left1 {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 8rpx 0;
    width: 336rpx;
    height: 88rpx;
    background-color: #fff;
    color: rgb(142, 84, 244);
    border: 2rpx solid rgb(142, 84, 244);
    border-radius: 8rpx;
    font-size: 32rpx;
    box-sizing: border-box;
    .top{
      font-size: 28rpx;
    }
    .bottom1{
      font-size: 20rpx;
    }
  }
  .right {
    width: 336rpx;
    height: 88rpx;
    text-align: center;
    line-height: 88rpx;
    color: #fff;
    background-color: rgb(142, 84, 244);
    border-radius: 8rpx;
    font-size: 32rpx;
    margin-left: 18rpx;
  }
}
.disable {
  color: rgb(220, 223, 230) !important;
  border-color: rgb(220, 223, 230) !important;
}
.isready{
  background-color: rgb(241,241,241) !important;
  color: rgb(192,196,204) !important;
}
</style>
